/*
 * main.cpp
 *
 *  Created on: Jan 31, 2010
 *      Author: lapointj
 */

#include "StopWatch.h"
#include <iostream>
#include <iomanip>
#include <cmath>

using std::cout;
using std::endl;
using std::fixed;
using std::setprecision;

void longTask(int multiplier)
{
   int maxX = 10 * multiplier;
   int maxY = 10 * multiplier;

   double result;

   for (int x = 0; x < maxX; ++x)
   {
      for (int y = 0; y < maxY; ++y)
      {
         result = sqrt((double) (x * x) + (double) (y * y));
      }
   }
}

int main()
{
   LinuxStopWatch::StopWatch myStopWatch;
   cout << fixed << setprecision(5);

   myStopWatch.start();
   longTask(300);
   myStopWatch.stop();
   cout << "First Timer = " << myStopWatch.getElapsedTime() << " milliseconds."
         << endl;

   myStopWatch.start();
   longTask(500);
   myStopWatch.stop();
   cout << "Second Timer = " << myStopWatch.getElapsedTime()
         << " milliseconds." << endl;

   cout << endl << endl;

   return 0;
}
